#include <stdio.h>

void reverse_array(int* arr, size_t len)
{
    int *start = arr;
    int *end = arr + len - 1;
    while (start<end)
    {
        int temp = *start;
        *start++ = *end;
        *end-- = temp;
    }
    
}

/**
 * 指针算术与内存块高效操作
*/
int main(int argc, char const *argv[])
{
    int arr[] = {1, 2, 3, 4, 5};
    reverse_array(arr, 5);
    for(int i=0; i<5; i++)
    {
        printf("%d\n", arr[i]);
    }
    
    return 0;
}